package com.yykt.myapp.controller;

import com.yykt.myapp.service.NewUserService;
import com.yykt.myapp.util.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("redis")
@RestController
public class RedisSample {

    @Autowired
    NewUserService newUserService;

    @GetMapping("getByAk")
    public JsonResult getByAk(@RequestParam String ak) {
        newUserService.setValue(ak, "wollll" + ak);
        Object value = newUserService.getValue(ak);
        return JsonResult.success(value);
    }
}
